home *** CD-ROM | disk | FTP | other *** search
- Path: news.tiac.net!usenet
- From: nield@tiac.net (John Nield)
- Newsgroups: comp.lang.c
- Subject: Re: Help: 2 short functions
- Date: Sat, 30 Mar 1996 21:53:47 GMT
- Organization: The Internet Access Company
- Message-ID: <4jkaim$rch@news.tiac.net>
- References: <4ji734$n6v@masala.cc.uh.edu> <29MAR199622515778@erich.triumf.ca> <4jit3o$f7l@news.tiac.net>
- Reply-To: nield@tiac.net
- NNTP-Posting-Host: nield.tiac.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- oops, never gave memory to fp. oh well. . . (jnield@versanet.com) ==
- (nield@tiac.net) == John Nield
-
- jnield@versanet.com (jnield@versanet.com) wrote:
-
- >FILE *open_file(char *filenamep)
- >{
- > FILE *fp;
- > if ( !(fp=fopen(filenamep,"r")) )
- > {failbad();}
- > /* a string literal is turned into a
- > character pointer when it is compiled, so
- > you can use filenamep as the string for fopen.
- > */
- > free(filenamep); /* assuming you want to do it now...
- > 'string' and all other pointers to the string
- > are now junk. */
- > return fp;
- >}
-
-
-
-
-
-
-
-
-
-
-